package com.zhc.dejingapi.controller;


import com.zhc.dejingapi.entity.query.EqRunMoldQtyQuery;
import com.zhc.dejingapi.service.SpcService;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhc
 * @since 2024-07-27
 */
@RestController
@RequestMapping("/spc-entity")
@CrossOrigin
public class SpcController {

    //@Resource
    private final SpcService spcService;

    public SpcController(SpcService spcService1) {
        this.spcService = spcService1;
    }

    @PostMapping("/getEqRunMoldQty")
    public long getEqRunMoldQty(@RequestBody EqRunMoldQtyQuery eqRunMoldQtyQuery) {
        return spcService.getEqRunMoldQty(eqRunMoldQtyQuery.getEqCode(),eqRunMoldQtyQuery.getReportStartTime(),eqRunMoldQtyQuery.getReportEndTime());
    }

    @PostMapping("/getEqRunMoldQtyOfTheMonth")
    public long getEqRunMoldQtyOfTheMonth() {
        return spcService.getEqRunMoldQtyOfTheMonth();
    }
}
